package com.sunnay.controller;

import com.sunnay.service.AppUserOpinionService;
import com.sunnay.util.R;
import com.sunnay.vo.opinion.OpinionVo;
import com.sunnay.web.ContextHelper;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

@RestController
@RequestMapping("/opinion")
public class OpinionController {

    @Resource
    private AppUserOpinionService opinionService;

    @PostMapping
    public R<Boolean> addOpinion(@RequestBody OpinionVo opinionVo){
        opinionService.addOpinion(opinionVo, ContextHelper.getSystemUser());
        return R.ok();
    }
}
